package com.gblfy.lykafka.controller;

import com.gblfy.lykafka.provider.KafkaProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
@RequestMapping("/kafka")
public class KafkaProviderController {

    @Autowired
    private KafkaProvider kafkaProvider;

    @GetMapping("/sendMQ")
    public String sendMQContent() {
        kafkaProvider.sendMessage(0001, "10", LocalDateTime.now());
        return "OK";
    }
}
